﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GroupProject
{
    public partial class frmMainMenu : Form
    {
        #region set form
        public static frmProducts fP;
        public static frmCategories fCa;
        public static frmCustomers fCu;
        public static frmEmployees fE;
        public static frmOrders fO;
        public static frmShippers fSh;
        public static frmSuppliers fSu;
        public static FtpStyleUriParser fSt;
        #endregion


        public frmMainMenu()
        {
            InitializeComponent();
        }

        private void btnEmployees_Click(object sender, EventArgs e)
        {
            if (fE == null || fE.IsDisposed)
            {
                fE = new frmEmployees();
                fE.Show();
            }
        }

        private void btnCategories_Click(object sender, EventArgs e)
        {

            if (fCa == null || fCa.IsDisposed)
            {
                fCa = new frmCategories();
                fCa.Show();
            }

        }

        private void btnCustomers_Click(object sender, EventArgs e)
        {
            if (fCu == null || fCu.IsDisposed)
            {
                fCu = new frmCustomers();
                fCu.Show();
            }

        }

        private void btnProducts_Click(object sender, EventArgs e)
        {
            if (fP == null || fP.IsDisposed)
            {
                fP = new frmProducts();
                fP.Show();
            }
            
        }

        private void btnShippers_Click(object sender, EventArgs e)
        {
            if (fSh == null || fSh.IsDisposed)
            {
                fSh = new frmShippers();
                fSh.Show();
            }

        }

        private void btnSuppliers_Click(object sender, EventArgs e)
        {
            if (fSu == null || fSu.IsDisposed)
            {
                fSu = new frmSuppliers();
                fSu.Show();
            }
        }

        private void btnOrders_Click(object sender, EventArgs e)
        {

            if (fO == null || fO.IsDisposed)
            {
                fO = new frmOrders();
                fO.Show();
            }
        }

        private void btnExit_Click(object sender, EventArgs e)
        {
            DialogResult r = MessageBox.Show("Are you sure?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (r == DialogResult.No)
            {
                return;
            }
            Application.Exit();
        }
    }
}
